<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<title>Document</title>
<script src="https://cdn.bootcss.com/jquery/3.3.1/jquery.min.js"></script>
<style type="text/css">
.bk{
	width:1000px;
	margin:0 auto;
}
</style>	
</head>
<body>
<p data-id="1" id="dom">内容</p>

</body>
<script type="text/javascript">

// $('#dom').data('id','2');//修改值
$('#dom').attr('data-id',3)
var aid = $('#dom').data('id');//获取值
console.log(aid)
</script>
</html>